home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesS-T.lzh / Scorpion.lha / ScorpionHd / Install next >
Text File  |  2002-06-16  |  10KB  |  334 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "")                       ;sub directory containing data files
  4. (set #readme-file "ReadMe")             ;name of readme file
  5. (set #man-file "Manual")                ;name of manual file
  6. (set #hint-file "Hints")                ;name of hint file
  7. (set #sol-file "Solution")              ;name of solution file
  8. (set #highs-file "Scorpion.save")               ;name of high scores file
  9. (set #last-file "disk.1")            ;last file the imager should create
  10. (set #prefix @app-name)                 ;name of slave, directory
  11.  
  12. (set #ico_suffix_00 "inf")              ;Icon suffixes (not all of these must exist)
  13. (set #ico_suffix_01 "magicwb")
  14. (set #ico_suffix_02 "romicon")
  15. (set #ico_suffix_03 "newicon")
  16. (set #ico_suffix_04 "newexot")
  17. (set #ico_suffix_05 "coloricon")
  18. (set #ico_suffix_06 "colexot")
  19. (set #ico_suffix_07 "colfrank")
  20. (set #ico_suffix_08 "colchris")
  21. (set #ico_suffix_09 "colcode")
  22. (set #ico_suffix_10 "colcfou")
  23. (set #ico_suffix_11 "colakira")
  24.  
  25. ;Icon descriptions (max 21 chars if you have > 9 entries, or 27 chars otherwise.
  26. ;These are renamed to "gamename.info" so no illegal characters like :/* etc
  27. ;                 "123456789012345678901234567"
  28. (set #ico_desc_00 "Normal")
  29. (set #ico_desc_01 "MagicWB Icon")
  30. (set #ico_desc_02 "RomIcon")
  31. (set #ico_desc_03 "NewIcon")
  32. (set #ico_desc_04 "NewIcon by Exotica")
  33. (set #ico_desc_05 "OS3.5 Icon")
  34. (set #ico_desc_06 "OS3.5 Icon by Exotica")
  35. (set #ico_desc_07 "OS3.5 Icon by Frank")
  36. (set #ico_desc_08 "OS3.5 Icon by Chris Vella")
  37. (set #ico_desc_09 "OS3.5 Icon by Codetapper")
  38. (set #ico_desc_10 "OS3.5 Icon by CFou")
  39. (set #ico_desc_11 "OS3.5 Icon by Akira")
  40.  
  41. ;****************************
  42. ;----------------------------
  43. ; checks if given program is installed, if not abort install
  44. ; #program - to check
  45.  
  46. (procedure P_ChkRun
  47.   (if (= 0 (run ("cd SYS:\nWhich %s >NIL:" #program)))
  48.     ("")
  49.     (abort
  50.       (cat
  51.         "You must install \"" #program "\" first!\n"
  52.         "It must be accessible via the path.\n"
  53.         "You can find it in the WHDLoad package."
  54.       )
  55.     )
  56.   )
  57. )
  58.  
  59. ;----------------------------
  60. ; copy file including icon if exist
  61. ; #copy-file - name of file to copy
  62.  
  63. (procedure P_CopyFile
  64.   (if (exists #copy-file) (
  65.     (copyfiles
  66.       (help @copyfiles-help)
  67.       (source #copy-file)
  68.       (dest #dest)
  69.     )
  70.     (if (exists ("%s.info" #copy-file)) (
  71.       (copyfiles
  72.         (help @copyfiles-help)
  73.         (source ("%s.info" #copy-file))
  74.         (dest #dest)
  75.       )
  76.       (tooltype
  77.         (dest (tackon #dest #copy-file))
  78.         (noposition)
  79.       )
  80.     ))
  81.   ))
  82. )
  83.  
  84. ;****************************
  85.  
  86. (if (< @installer-version (+ (* 44 65536) 10))
  87.   (
  88.     (message
  89.       (cat
  90.         "Warning: your installer is outdated.\n"
  91.         "Some features of this installation won't be available, "
  92.         "such as icon show and drawer opening. "
  93.         "You have version " (/ @installer-version 65536) "." 
  94.         (BITAND @installer-version 65535) ", recommended is version 44.10. "
  95.         "The 'installer' 44.10 comes with OS 3.5 but is also contained in the NDK 3.9. "
  96.         "You may also use the InstallerNG by Jens Tröger."
  97.         "\n\n"
  98.         "The installers can be obtained from the net:\n"
  99.         "http://www.amiga.com/3.9/download/NDK3.9.lha\n"
  100.         "aminet:util/sys/InstallerNG.lha"
  101.       )
  102.     )
  103.     (set #newstuff 0)
  104.   )
  105.   (set #newstuff 1)
  106. )
  107.  
  108. (if (exists #readme-file)
  109.   (if (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  110.     ("")
  111.     (run ("SYS:Utilities/More %s" #readme-file))
  112.   )
  113. )
  114.  
  115. (set #program "WHDLoad")
  116. (P_ChkRun)
  117.  
  118. (set #program "RawDIC")
  119. (P_ChkRun)
  120.  
  121. (if (= @user-level 2)
  122.   (
  123.     (set #CI_drive
  124.       (askchoice
  125.         (prompt "Select source drive for diskimages")
  126.         (default 0)
  127.         (choices "DF0:" "DF1:" "DF2:" "DF3:")
  128.         (help @askchoice-help)
  129.       )
  130.     )
  131.     (select #CI_drive
  132.       (set #CI_drive "DF0:")
  133.       (set #CI_drive "DF1:")
  134.       (set #CI_drive "DF2:")
  135.       (set #CI_drive "DF3:")
  136.     )
  137.     (set #ignore " IGNOREERRORS")
  138.   )
  139.   (set #CI_drive "DF0:")
  140.   (set #ignore "")
  141. )
  142.  
  143. (if (getenv "WHDLInstPath")
  144.   (set @default-dest (getenv "WHDLInstPath"))
  145. )
  146. (set #dest
  147.   (askdir
  148.     (prompt
  149.       (cat
  150.         "Where should \"" @app-name "\" be installed?\n"
  151.         "A drawer \"" #prefix "\" will be automatically created."
  152.       )
  153.     )
  154.     (help @askdir-help)
  155.     (default @default-dest)
  156.   )
  157. )
  158. (run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" #dest))
  159. (set #dest (tackon #dest #prefix))
  160. (if (exists #dest) (
  161.   (set #choice
  162.     (askbool
  163.       (prompt
  164.         (cat
  165.           "\nDirectory \"" #dest "\" already exists.\n"
  166.           "Should it be deleted?"
  167.         )
  168.       )
  169.       (default 1)
  170.       (choices "Delete" "Skip")
  171.       (help @askbool-help)
  172.     )
  173.   )
  174.   (if (= #choice 1)
  175.     (delete #dest
  176.       (help @delete-help)
  177.       (all)
  178.     )
  179.   )
  180. ))
  181. (makedir #dest
  182.   (help @makedir-help)
  183.   (infos)
  184. )
  185.  
  186. ;----------------------------
  187.  
  188. (copyfiles
  189.   (help @copyfiles-help)
  190.   (source ("%s.Slave" #prefix))
  191.   (dest #dest)
  192. )
  193. (set #icon 0)
  194. (if (exists ("%s.%s" #prefix #ico_suffix_11)) ((set #icon 11)(set #icnt (+ 1 #icnt))(set #icon_11 #ico_desc_11)) (set #icon_11 ""))
  195. (if (exists ("%s.%s" #prefix #ico_suffix_10)) ((set #icon 10)(set #icnt (+ 1 #icnt))(set #icon_10 #ico_desc_10)) (set #icon_10 ""))
  196. (if (exists ("%s.%s" #prefix #ico_suffix_09)) ((set #icon 9) (set #icnt (+ 1 #icnt))(set #icon_09 #ico_desc_09)) (set #icon_09 ""))
  197. (if (exists ("%s.%s" #prefix #ico_suffix_08)) ((set #icon 8) (set #icnt (+ 1 #icnt))(set #icon_08 #ico_desc_08)) (set #icon_08 ""))
  198. (if (exists ("%s.%s" #prefix #ico_suffix_07)) ((set #icon 7) (set #icnt (+ 1 #icnt))(set #icon_07 #ico_desc_07)) (set #icon_07 ""))
  199. (if (exists ("%s.%s" #prefix #ico_suffix_06)) ((set #icon 6) (set #icnt (+ 1 #icnt))(set #icon_06 #ico_desc_06)) (set #icon_06 ""))
  200. (if (exists ("%s.%s" #prefix #ico_suffix_05)) ((set #icon 5) (set #icnt (+ 1 #icnt))(set #icon_05 #ico_desc_05)) (set #icon_05 ""))
  201. (if (exists ("%s.%s" #prefix #ico_suffix_04)) ((set #icon 4) (set #icnt (+ 1 #icnt))(set #icon_04 #ico_desc_04)) (set #icon_04 ""))
  202. (if (exists ("%s.%s" #prefix #ico_suffix_03)) ((set #icon 3) (set #icnt (+ 1 #icnt))(set #icon_03 #ico_desc_03)) (set #icon_03 ""))
  203. (if (exists ("%s.%s" #prefix #ico_suffix_02)) ((set #icon 2) (set #icnt (+ 1 #icnt))(set #icon_02 #ico_desc_02)) (set #icon_02 ""))
  204. (if (exists ("%s.%s" #prefix #ico_suffix_01)) ((set #icon 1) (set #icnt (+ 1 #icnt))(set #icon_01 #ico_desc_01)) (set #icon_01 ""))
  205. (if (exists ("%s.%s" #prefix #ico_suffix_00)) ((set #icon 0) (set #icnt (+ 1 #icnt))(set #icon_00 #ico_desc_00)) (set #icon_00 ""))
  206. (procedure P_Icon
  207.   (copyfiles
  208.     (help @copyfiles-help)
  209.     (source ("%s.%s" #prefix #icon-suf))
  210.     (newname ("%s.info" #icon-name))
  211.     (dest #icon-dir)
  212.   )
  213.   (tooltype
  214.     (dest (tackon #icon-dir #icon-name))
  215.     (noposition)
  216.   )
  217. )
  218. (if (> #icnt 1) (
  219.   (if (= #newstuff 1) (
  220.     (set #icon-dir ("T:%s Icons" #prefix))
  221.     (makedir #icon-dir
  222.       (help @makedir-help)
  223.     )
  224.     (if #icon_00 ((set #icon-suf #ico_suffix_00) (set #icon-name #ico_desc_00) (P_Icon)))
  225.     (if #icon_01 ((set #icon-suf #ico_suffix_01) (set #icon-name #ico_desc_01) (P_Icon)))
  226.     (if #icon_02 ((set #icon-suf #ico_suffix_02) (set #icon-name #ico_desc_02) (P_Icon)))
  227.     (if #icon_03 ((set #icon-suf #ico_suffix_03) (set #icon-name #ico_desc_03) (P_Icon)))
  228.     (if #icon_04 ((set #icon-suf #ico_suffix_04) (set #icon-name #ico_desc_04) (P_Icon)))
  229.     (if #icon_05 ((set #icon-suf #ico_suffix_05) (set #icon-name #ico_desc_05) (P_Icon)))
  230.     (if #icon_06 ((set #icon-suf #ico_suffix_06) (set #icon-name #ico_desc_06) (P_Icon)))
  231.     (if #icon_07 ((set #icon-suf #ico_suffix_07) (set #icon-name #ico_desc_07) (P_Icon)))
  232.     (if #icon_08 ((set #icon-suf #ico_suffix_08) (set #icon-name #ico_desc_08) (P_Icon)))
  233.     (if #icon_09 ((set #icon-suf #ico_suffix_09) (set #icon-name #ico_desc_09) (P_Icon)))
  234.     (if #icon_10 ((set #icon-suf #ico_suffix_10) (set #icon-name #ico_desc_10) (P_Icon)))
  235.     (if #icon_11 ((set #icon-suf #ico_suffix_11) (set #icon-name #ico_desc_11) (P_Icon)))
  236.     (openwbobject #icon-dir)
  237.   ))
  238.   (set #icon
  239.     (askchoice
  240.       (prompt "\nWhich icon would you like to install?\n")
  241.       (choices #icon_00 #icon_01 #icon_02 #icon_03 #icon_04 #icon_05 #icon_06 #icon_07 #icon_08 #icon_09 #icon_10 #icon_11)
  242.       (default #icon)
  243.       (help @askchoice-help)
  244.     )
  245.   )
  246.   (if (= #newstuff 1) (
  247.     (closewbobject #icon-dir)
  248.     (delete #icon-dir
  249.       (help @delete-help)
  250.       (all)
  251.     )
  252.   ))
  253. ))
  254. (select #icon
  255.   (set #icon #ico_suffix_00)
  256.   (set #icon #ico_suffix_01)
  257.   (set #icon #ico_suffix_02)
  258.   (set #icon #ico_suffix_03)
  259.   (set #icon #ico_suffix_04)
  260.   (set #icon #ico_suffix_05)
  261.   (set #icon #ico_suffix_06)
  262.   (set #icon #ico_suffix_07)
  263.   (set #icon #ico_suffix_08)
  264.   (set #icon #ico_suffix_09)
  265.   (set #icon #ico_suffix_10)
  266.   (set #icon #ico_suffix_11)
  267. )
  268. (copyfiles
  269.   (help @copyfiles-help)
  270.   (source ("%s.%s" #prefix #icon))
  271.   (newname ("%s.info" #prefix))
  272.   (dest #dest)
  273. )
  274. (if (= #icon "newicon")
  275.   ("")
  276.   (
  277.     (tooltype
  278.       (dest (tackon #dest #prefix))
  279.       (settooltype "Slave")
  280.       (settooltype "PreLoad")
  281.       (settooltype "CUSTOM1")
  282.       (settooltype "CUSTOM2")
  283.     )
  284.     (tooltype
  285.       (dest (tackon #dest #prefix))
  286.       (settooltype "CUSTOM2" "1")
  287.       (settooltype "CUSTOM1" "0")
  288.       (settooltype "PreLoad" "")
  289.       (settooltype "Slave" ("%s.Slave" #prefix))
  290.     )
  291.   )
  292. )
  293. (tooltype
  294.   (dest (tackon #dest #prefix))
  295.   (setdefaulttool "WHDLoad")
  296.   (setstack 10240)
  297.   (noposition)
  298. )
  299. (set #copy-file #readme-file)
  300. (P_CopyFile)
  301. (set #copy-file #man-file)
  302. (P_CopyFile)
  303. (set #copy-file #hint-file)
  304. (P_CopyFile)
  305. (set #copy-file #sol-file)
  306. (P_CopyFile)
  307. (set #dest-org #dest)
  308. (if (= #sub-dir "")
  309.   ("")
  310.   (
  311.     (set #dest (tackon #dest #sub-dir))
  312.     (makedir #dest
  313.       (help @makedir-help)
  314.     )
  315.   )
  316. )
  317. (set #copy-file #highs-file)
  318. (P_CopyFile)
  319. (copyfiles
  320.   (help @copyfiles-help)
  321.   (source ("%s.ISlave" #prefix))
  322.   (dest #dest)
  323. )
  324. (working "calling RawDIC...")
  325. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s%s\nDelete %s.ISlave Quiet" #dest #prefix #CI_drive #ignore #prefix))
  326. (if (exists (tackon #dest #last-file))
  327.   ("")
  328.   (abort "Diskimaging was not successful!\nRawDIC was unable to create all needed files!")
  329. )
  330. (if (= #newstuff 1)
  331.   (openwbobject #dest-org)
  332. )
  333. (exit)
  334.